home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 169 / 169.d81 / monkey match (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1998-01-01  |  11.2 KB  |  388 lines

  1. 8 poke53371,0
  2. 10 poke53280,.:poke53281,.:print"":gosub2860:gosub1680
  3. 20 rem -- main screen --
  4. 30 poke53281,.:poke53280,6:print"[147]"
  5. 40 printtab(30)"[149][216][217][218][219]":printtab(30)"[129][220][221][255][223]"
  6. 50 printtab(30)"[160][161][162][163]":printtab(30)"[164][165][166][167]"
  7. 60 printtab(27)" player 1 ":printtab(26)"score : 0000"
  8. 70 printtab(30)"[150][200][201][202][203]":printtab(30)"[204][205][206][207]"
  9. 80 printtab(30)"[208][209][210][211]":printtab(30)"[155][212][213][214][215]"
  10. 90 printtab(27)" player 2 ":printtab(26)"score : 0000"
  11. 100 printtab(25)"              "
  12. 110 print"  letter    animal  "
  13. 120 printtab(25)"[152]abcdefghijklm"
  14. 130 print" help  credits  quit ";
  15. 140 print"[146][152]nopqrstuvwxyz"
  16. 150 fori=1to30:sysml+36,i,27,14:next
  17. 160 rem -- setup --
  18. 170 sysml+39,224:sysml+30,11,28,10,14,160,20
  19. 180 poke214,11:print:printtab(13)"[156]monkey mixing!"
  20. 190 pokev+2,35:pl=0:mv=0:sc(1)=0:sc(2)=0
  21. 200 fori=.to1:forj=1to15:a%(i*15+j)=j:next:next
  22. 210 fori=1to30:f=int(rnd(1)*30+1):x=a%(i):a%(i)=a%(f):a%(f)=x:next
  23. 220 fori=.to25:poke832+i,.:next
  24. 230 an$=a$(rnd(1)*a%):tb=32-len(an$)/2
  25. 240 sysml+42,224
  26. 250 poke214,19:print:printtab(tb);
  27. 260 fori=1tolen(an$)
  28. 270 ifmid$(an$,i,1)=" "thenprint" ";:goto290
  29. 280 print"[154]]";
  30. 290 next
  31. 300 rem -- begin --
  32. 310 sysml+12,27,6," player 1 "
  33. 320 sysml+12,27,15," player 2 "
  34. 330 pl=pl+1:ifpl>2thenpl=1
  35. 340 poke214,(pl-1)*9+5:print:printtab(27)"[156] player"pl"[157] "
  36. 350 rem -- main --
  37. 358 sysml+21,xa,ya
  38. 360 sysml+9:ifcr%then390
  39. 362 sysml+60,"[145][157]":ifi%=0then360
  40. 364 ifi%=1thenya=ya-1:ifya<0thenya=0
  41. 365 ifi%=2thenya=ya+1:ifya>24thenya=24
  42. 366 ifi%=3thenxa=xa-1:ifxa<0thenxa=0
  43. 367 ifi%=4thenxa=xa+1:ifxa>39thenxa=39
  44. 370 goto358
  45. 380 rem -- display 1st animal --
  46. 390 ifcr%>30then690
  47. 400 ifa%(cr%)=0orcr%=mvthen360
  48. 410 ifmvthen480
  49. 420 sysml+36,cr%,32,0
  50. 430 f=a%(cr%):sysml+129,f2+(f-1)*72,f2+(f-1)*72+72,f1+1792
  51. 440 poke214,int((cr%-1)/6)*4:print
  52. 450 poke646,cl(f):f=peek((cr%-1)*4+rl):printtab(f)a1$
  53. 460 gosub2510:mv=cr%:goto360
  54. 470 rem -- display 2nd animal --
  55. 480 sysml+36,cr%,32,0
  56. 490 f=a%(cr%):sysml+129,f2+(f-1)*72,f2+(f-1)*72+72,f1+1864
  57. 500 poke214,int((cr%-1)/6)*4:print
  58. 510 poke646,cl(f):f=peek((cr%-1)*4+rl):printtab(f)a2$
  59. 520 gosub2510:poke53370,0:forde=.to500:next:poke53371,0
  60. 530 ifa%(mv)=a%(cr%)then580
  61. 540 rem -- no match --
  62. 550 gosub2640:sysml+36,mv,27,14:sysml+36,cr%,27,14
  63. 560 mv=0:goto310
  64. 570 rem -- match --
  65. 580 gosub2550:sc(pl)=sc(pl)+100:gosub630
  66. 590 a%(cr%)=0:a%(mv)=0
  67. 600 sysml+36,mv,32,0:sysml+36,cr%,32,0
  68. 610 mv=0:goto360
  69. 620 rem -- update score --
  70. 630 a$=str$(sc(pl)):a$=right$(a$,len(a$)-1)
  71. 640 poke214,(pl-1)*9+7:print
  72. 650 printtab(34)"0000[145]"
  73. 660 printtab(38-len(a$))a$
  74. 670 return
  75. 680 rem -- options --
  76. 690 sysml+36,cr%,255,1
  77. 700 oncr%-30goto720,890,1880,1270,1560
  78. 710 rem -- guess letter --
  79. 720 t=0:ifsc(pl)=0ormvthengosub2600:sysml+36,cr%,255,6:goto360
  80. 730 gosub2510:sysml+36,cr%,255,6
  81. 740 sysml+12,25,18,"[156]what letter?  ":f=49910
  82. 742 poke198,0
  83. 750 x=peek(f)and127:t=t+1and15:pokef,x-(t<8)*128
  84. 760 geta$:ifa$<"a"ora$>"z"then750
  85. 770 print"[146][157]"a$
  86. 780 printtab(25)"[145]              "
  87. 790 ifpeek(832+asc(a$)-65)thengosub2600:goto360
  88. 800 fl=0:fori=1tolen(an$)
  89. 810 ifa$=mid$(an$,i,1)thenprinttab(tb);:printspc(i-1)""a$"[145]":gosub2510:fl=1
  90. 820 next
  91. 830 f=asc(a$)-64:poke831+f,1
  92. 840 poke214,21-(f>13):print
  93. 850 f=(f>13)*13+f:printtab(24+f)""a$
  94. 860 sc(pl)=sc(pl)-25:gosub630:iffl=0thengosub2640:goto310
  95. 870 goto360
  96. 880 rem -- guess animal --
  97. 890 ifsc(pl)<50ormvthengosub2600:sysml+36,cr%,255,6:goto360
  98. 900 gosub2510:sysml+36,cr%,255,6
  99. 910 sysml+39,224
  100. 920 sysml+12,26,18,"[156]what animal?[136]"
  101. 930 t=0:x1=49912+tb:x2=x1+len(an$)-1:f=x1
  102. 940 x=peek(f)and127:t=t+1and15:pokef,x-(t<8)*128
  103. 950 geta$:ifa$=""then940
  104. 960 ifa$=chr$(13)thenpokef,peek(f)and127:goto1090
  105. 970 ifa$=chr$(20)thenpokef,32:gosub1060:goto940
  106. 980 ifa$=""thenpokef,peek(f)and127:goto1030
  107. 990 ifa$="[157]"thenpokef,peek(f)and127:gosub1060:goto940
  108. 1000 ifa$=" "thenpokef,32:goto1030
  109. 1010 ifa$<"a"ora$>"z"then950
  110. 1020 pokef,asc(a$)-64
  111. 1030 f=f+1:iff>x2thenf=x2
  112. 1040 t=0:goto940
  113. 1050 rem -- delete/crsr left --
  114. 1060 f=f-1:iff<x1thenf=x1
  115. 1070 t=0:return
  116. 1080 rem -- check answer --
  117. 1090 print"[145]            "
  118. 1100 f=0:x1=49911+tb:fori=1tolen(an$)
  119. 1110 x=peek(x1+i):ifx=32andmid$(an$,i,1)=" "then1130
  120. 1120 ifasc(mid$(an$,i,1))<>x+64thenf=1
  121. 1130 next
  122. 1140 iff=1thengosub2640:sysml+42,224:sc(pl)=sc(pl)-50:gosub630:goto310
  123. 1150 rem -- winner --
  124. 1160 gosub2710:poke214,(pl-1)*9+5:print
  125. 1170 fori=.to1
  126. 1180 printtab(27)" [156] winner [146] "
  127. 1190 gosub2510:forde=.to300:next
  128. 1200 printtab(27)"[145] player"pl"[157] [145]"
  129. 1210 gosub2510:forde=.to300:next
  130. 1220 next
  131. 1230 printtab(27)"  winner [146] "
  132. 1240 gosub2510:forde=.to300:next
  133. 1250 goto1460
  134. 1260 rem -- credits --
  135. 1270 gosub2510:sysml+36,cr%,255,6
  136. 1280 sysml+39,224
  137. 1290 sysml+30,5,34,8,16,160,19
  138. 1300 poke214,9:print
  139. 1310 printtab(7)"[159]program, design & graphics"
  140. 1320 printtab(12)"pineapple monkey"
  141. 1330 printtab(7)"mr mouse jr  sound effects"
  142. 1340 printtab(8)"lee novak    ls programs"
  143. 1350 sysml+9:ifl2%=0then1350
  144. 1360 sysml+42,224:goto360
  145. 1370 rem -- box 1 --
  146. 1380 pokev+10,32:pokev+11,66:pokev+12,67:pokev+13,64:pokev+14,65
  147. 1390 pokev+15,68:pokev+16,69:pokev+17,70:pokev+18,71
  148. 1400 return
  149. 1410 rem -- box 2 --
  150. 1420 pokev+10,160:pokev+11,105:pokev+12,111:pokev+13,104:pokev+14,110
  151. 1430 pokev+15,106:pokev+16,107:pokev+17,108:pokev+18,109
  152. 1440 return
  153. 1450 rem -- play again? --
  154. 1460 pokev+2,39:sysml+39,224
  155. 1470 sysml+30,5,34,8,16,160,24
  156. 1480 poke214,9:print
  157. 1490 printtab(7)"[129]do you want to play again?"
  158. 1500 sysml+30,11,15,12,14,160,26:sysml+30,24,28,12,14,160,26
  159. 1510 printtab(13)"[150]y[129]or[150]n"
  160. 1520 sysml+9:sysml+60,"yn":if(cr%<38)and(i%=0)then1520
  161. 1530 gosub2510:if(cr%=38)or(i%=1)then30
  162. 1540 poke53269,.:sysml+126,4,24:sysml+3:goto40000
  163. 1550 rem -- quit --
  164. 1560 gosub2510:sysml+36,cr%,255,6
  165. 1570 pokev+2,37:sysml+39,224
  166. 1580 sysml+30,8,31,8,16,160,26
  167. 1590 poke214,9:print
  168. 1600 printtab(10)"[150]do you want to quit?"
  169. 1610 sysml+30,12,16,12,14,160,20:sysml+30,23,27,12,14,160,20
  170. 1620 printtab(14)"[156]y[150]or[156]n"
  171. 1630 sysml+9:sysml+60,"yn":if(cr%<36)and(i%=0)then1630
  172. 1640 gosub2510
  173. 1650 sysml+42,224:if(cr%=36)or(i%=1)then1460
  174. 1660 pokev+2,35:goto360
  175. 1670 rem -- title screen --
  176. 1680 print"[147]":poke53265,11:gosub1380
  177. 1690 sysml+126,192,240
  178. 1700 sysml+30,0,39,0,24,27,14
  179. 1710 sysml+30,3,38,4,22,27,6
  180. 1720 sysml+30,2,37,3,21,27,31
  181. 1730 poke214,4:print
  182. 1740 printtab(5)"[198][197][146]loadstar proudly[198][197]"
  183. 1750 printtab(4)"[217]  [255]"tab(32)"[217]  [255]"
  184. 1760 printtab(5)"[255][217][146]presents[255][217]"
  185. 1770 print"[158][192][193][194][195][200][196][192][197][194][192][198][199][195][200][201][192][194][192][193][194][195][200][196][202] [203][195][200][201][192][194]"
  186. 1780 print"[150][204][213][205][204][205][204] [205][204] [207][204][208][215][209][216][204][213][205][204][210][205] [204][204][211][205]"
  187. 1790 print"[129][212][214][215][219][216][212][217][214][212][217][218][215][219][220][221][212][214][212][214][221][215][219][220][212][214]"
  188. 1800 printtab(9)"[156]a game for two players"
  189. 1810 printtab(10)"on the commodore 64!"
  190. 1820 printtab(4)"(c) 1998 by j&f publishing, inc."
  191. 1830 gosub2710:poke53265,27:poke53280,6
  192. 1840 sysml+9:ifl2%=0then1840
  193. 1850 gosub2510:gosub1420
  194. 1860 sysml+6,50432:return
  195. 1870 rem -- directions --
  196. 1880 gosub2510:sysml+36,cr%,255,6
  197. 1890 sysml+39,224:gosub1380
  198. 1900 sysml+129,f2+1792,f2+2048,f1+1792
  199. 1910 poke53281,.:poke53280,.:print"[147]"
  200. 1920 sysml+30,0,39,0,24,30,6
  201. 1930 sysml+30,1,38,1,23,30,31
  202. 1940 printtab(15)"[159]directions"
  203. 1950 print"[149][216][217][218][219]"
  204. 1960 print"[129][220][221][255][223][156]hello, it is so nice to meet"
  205. 1970 print"[129][160][161][162][163][156]you. i am pineapple monkey,"
  206. 1980 print"[129][160][161][162][163][146][156]and i would like to welcome"
  207. 1990 print"[164][165][166][167][146][156]you to my latest game,"
  208. 2000 print"[168][169][170][171][146][156]monkey match. it is a game"
  209. 2010 print"[172][173][174][175][146][156]for two players, so i hope"
  210. 2020 print"[176][177][178][179][146][156]that you have someone with"
  211. 2030 print"[180][181][182][183][146][156]you to play with. now i will"
  212. 2040 print"[184][185][186][187][146][156]tell you all about how to"
  213. 2050 print"[188][189][190][191][146][156]play monkey match."
  214. 2060 print"at the start of each game a secret"
  215. 2070 print"animal will be selected from a word"
  216. 2080 print"list. this could be anything from a"
  217. 2090 print"mammal, a reptile, a bird, or maybe"
  218. 2100 print"even a fishy. each player's goal is"
  219. 2110 print"to name this animal."
  220. 2120 printtab(14)"[159]press button"
  221. 2130 sysml+9:ifl2%=0then2130
  222. 2140 gosub2510:fori=21to3step-1:sysml+30,2,37,i,i,32,0:next
  223. 2150 print"[156]when it is your turn you will have"
  224. 2160 print"following options available:"
  225. 2170 print"[176][177] [156]click on a tile to reveal an"
  226. 2180 print"[129][178][179] [156]animal then on another. if you"
  227. 2190 print"[129][180][181] [156]make a match you gain 100 [156]pts"
  228. 2200 print"   [156]and your turn will continue."
  229. 2210 print"[176][177] [156]if you have at least 25 [156]pts you"
  230. 2220 print"[129][178][179] [156]can buy a letter. if the secret"
  231. 2230 print"[129][180][181] [156]animal's name has that letter in"
  232. 2240 print"   [156]it your turn continues."
  233. 2250 print"[176][177] [156]if you have at least 50 [156]pts you"
  234. 2260 print"[129][178][179] [156]can try to guess the name of the"
  235. 2270 print"[129][180][181] [156]secret animal. if you guess"
  236. 2280 print"   correctly you win!"
  237. 2290 sysml+9:ifl2%=0then2290
  238. 2300 gosub2510:fori=21to3step-1:sysml+30,2,37,i,i,32,0:next
  239. 2310 print"that is all there is to it. monkey"
  240. 2320 print"match is a simple game, but i hope"
  241. 2330 print"it is one you will enjoy."
  242. 2340 print"i must leave you now. for i have an"
  243. 2350 print"important meeting with an individual"
  244. 2360 print"who wants to trade pineapples for"
  245. 2370 print"coconuts. luckily, i have a lovely"
  246. 2380 print"set of coconuts. so we shall play a"
  247. 2390 print"game where both of us will try to"
  248. 2400 print"get the best of the bargain. i"
  249. 2410 print"almost feel sorry for the poor"
  250. 2420 print"fellow...he has no hands!"
  251. 2430 print"oops. i am so sorry. i meant to say"
  252. 2440 print"he has no chance. for i will not be"
  253. 2450 print"beaten. i am pineapple monkey!!!"
  254. 2460 sysml+9:ifl2%=0then2460
  255. 2470 gosub2510
  256. 2480 ifmvthenf=a%(mv):sysml+129,f2+(f-1)*72,f2+(f-1)*72+72,f1+1792
  257. 2490 gosub1420:sysml+42,224:goto360
  258. 2500 rem -- blip --
  259. 2510 poke53370,0:pokes+5,10:pokes+6,73:pokes+4,17:pokes+1,30:pokes,0
  260. 2520 forde=.to50:next:pokes+4,16:poke53371,0
  261. 2530 return
  262. 2540 rem -- match --
  263. 2550 poke53370,0:pokes+6,225:pokes+4,17
  264. 2560 fori=1to7:forde=1to180step20
  265. 2570 pokes+1,de:next:next
  266. 2580 pokes+4,0:poke53371,0:return
  267. 2590 rem -- boop --
  268. 2600 poke53370,0:pokes+3,8:pokes+5,15:pokes+6,1:pokes,102:pokes+1,2
  269. 2610 pokes+4,65:forde=.to99:next:pokes+4,64:poke53371,0
  270. 2620 return
  271. 2630 rem -- no match --
  272. 2640 poke53370,0:pokes+5,129:pokes+6,129:pokes+3,145:pokes+4,33:pokes+1,14
  273. 2650 forde=1to100:next
  274. 2660 fori=14to3step-1
  275. 2670 pokes+1,i:forde=.to18:next
  276. 2680 next:pokes+4,32:poke53371,0
  277. 2690 return
  278. 2700 rem -- you win! --
  279. 2710 poke53370,0:fori=1to2
  280. 2720 pokes+1,14:pokes+5,3:pokes+6,240
  281. 2730 pokes+24,15:pokes+4,17
  282. 2740 forj=6to10:fork=1to12stepsin(j)
  283. 2750 pokes+1,4*k:pokes+4,17
  284. 2760 next:next
  285. 2770 pokes+4,16:forde=1to10:next
  286. 2780 pokes+1,14:pokes+5,3:pokes+6,240
  287. 2790 pokes+24,15:pokes+4,17
  288. 2800 forj=6to10:fork=1to12steplog(j)
  289. 2810 pokes+1,4*k:pokes+4,17
  290. 2820 next:next
  291. 2830 pokes+4,16:forde=1to100:next
  292. 2840 next:poke53371,0:return
  293. 2850 rem -- initialize --
  294. 2860 ml=199*256:v=ml+156:rl=50176:f1=61440:f2=59392:s=54272:a%=115:f=rnd(-ti)
  295. 2862 xa=10:ya=10
  296. 2870 fori=.to23:pokes+i,.:next:pokes+24,15
  297. 2880 a1$="[160][161][162][157][157][157][163][164][165][157][157][157][166][167][168]":a2$="[169][170][171][157][157][157][172][173][174][157][157][157][175][176][177]"
  298. 2890 sysml:pokev+19,128
  299. 2900 sysml+18,0,39,0,24
  300. 2910 rem -- define regions --
  301. 2920 pokev+1,196:fori=.to4:forj=1to6
  302. 2930 sysml+15,i*6+j,(j-1)*4+1,(j-1)*4+3,i*4+1,i*4+3
  303. 2940 next:next
  304. 2950 sysml+15,31,2,11,21,21:sysml+15,32,13,22,21,21
  305. 2960 sysml+15,33,1,6,23,23:sysml+15,34,8,16,23,23:sysml+15,35,18,23,23,23
  306. 2970 sysml+15,36,12,16,12,14:sysml+15,37,23,27,12,14
  307. 2980 sysml+15,38,11,15,12,14:sysml+15,39,24,28,12,14
  308. 2990 rem -- arrays --
  309. 3000 dima%(30),cl(15),pl(2),sc(2),a$(a%)
  310. 3010 fori=1to15:readcl(i):next
  311. 3020 fori=.toa%:reada$(i):next
  312. 3030 return
  313. 3040 rem -- animal colors --
  314. 3050 data1,3,4,8,10,8,1,12,5,1,14,15,10,8,2
  315. 3060 rem -- animal names --
  316. 3070 data aardvark,antelope
  317. 3080 data armadillo,barbary ape
  318. 3090 data blue whale,cheetah
  319. 3100 data chimpanzee,chipmunk
  320. 3110 data chihuahua,coyote
  321. 3120 data dalmatian,dolphin
  322. 3130 data donkey,elephant
  323. 3140 data field mouse,gazelle
  324. 3150 data giant panda,giraffe
  325. 3160 data gibbon,gopher
  326. 3170 data gorilla,grizzly bear
  327. 3180 data groundhog,guinea pig
  328. 3190 data hedgehog,hippopotamus
  329. 3200 data homo sapien,humpback whale
  330. 3210 data hyena,kangaroo
  331. 3220 data lemming,leopard
  332. 3230 data llama,manatee
  333. 3240 data mongoose,mountain goat
  334. 3250 data mustang,ocelot
  335. 3260 data orangutan,polar bear
  336. 3270 data porcupine,porpoise
  337. 3280 data reindeer,rhinoceros
  338. 3290 data saint bernard,shetland pony
  339. 3300 data siamese cat,silky terrier
  340. 3310 data spider monkey,squirrel
  341. 3320 data vampire bat,wallaby
  342. 3330 data walrus,warthog
  343. 3340 data water buffalo,wolverine
  344. 3350 data wooly monkey,zebra
  345. 3360 :
  346. 3370 data bald eagle,blue jay
  347. 3380 data bullfinch,buzzard
  348. 3390 data canary,cardinal
  349. 3400 data chickadee,chicken
  350. 3410 data cockatoo,falcon
  351. 3420 data flamingo,goldfinch
  352. 3430 data hermit thrush,homing pigeon
  353. 3440 data hummingbird,mallard
  354. 3450 data meadowlark,mockingbird
  355. 3460 data nighthawk,nightingale
  356. 3470 data ostrich,parakeet
  357. 3480 data parrot,partridge
  358. 3490 data pelican,penguin
  359. 3500 data pheasant,roadrunner
  360. 3510 data sea gull,skylark
  361. 3520 data sparrow,swallow
  362. 3530 data toucan,turkey
  363. 3540 data turtledove,vulture
  364. 3550 data whooping crane,woodpecker
  365. 3560 :
  366. 3570 data alligator,anaconda
  367. 3580 data basilisk,bullfrog
  368. 3590 data chameleon,crocodile
  369. 3600 data gila monster,komodo dragon
  370. 3610 data rattlesnake,salamander
  371. 3620 data snapping turtle,tortoise
  372. 3630 :
  373. 3640 data angelfish,barracuda
  374. 3650 data electric eel,piranha
  375. 3660 data sea horse,stingray
  376. 3670 data swordfish,white shark
  377. 10000 d=peek(186):n$="0:monkey match":open15,d,15,"s"+n$:close15:saven$,d:end
  378. 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
  379. 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
  380. 40020 print"[147]":poke53272,23:poke186,8:poke2048,0:poke44,8:poke43,1:end
  381. 40030 forj=8to29:i=peek(820+j):ifi=14thennext
  382. 40040 close2:open2,i,2:close2:ifstthen40060
  383. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  384. 40060 next:return
  385. 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  386. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  387. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  388.